<%@page import="java.net.URLEncoder"%>
<%@ page language="java"   pageEncoding="UTF-8"%>
<%@ include file="../../common.jsp"%>
<%
String ck=request.getParameter("check");
String filedownload ="";//即将下载的文件的相对路径
String filedisplay = "";//下载文件时显示的文件保存名称
response.setContentType("application/x-download");//设置为下载application/x-download
if(ck!=null&&"1".equals(ck)){
    filedownload ="/OrderDetail.xls";//即将下载的文件的相对路径
    filedisplay = "订单导入模板 ["+DateUtil.getCurrentDate("yyyy-MM-dd")+"].xls";//下载文件时显示的文件保存名称
}else{
    filedownload ="/mnufacture.xls";//即将下载的文件的相对路径
    filedisplay = "产品导入模板 ["+DateUtil.getCurrentDate("yyyy-MM-dd")+"].xls";//下载文件时显示的文件保存名称
}
filedisplay = URLEncoder.encode(filedisplay,"UTF-8");
response.addHeader("Content-Disposition","attachment;filename=" + filedisplay);
try{
  RequestDispatcher dis = application.getRequestDispatcher(filedownload);
  if(dis!= null)
  {
      dis.forward(request,response);
  }
  response.flushBuffer();
  }
  catch(Exception e)
  {
      e.printStackTrace();
  }
%>